/* 番茄钟主容器 */
.pomodoro-timer {
    position: absolute;
    top: 85%;
    left: 55%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #ffffff, #f0f2f5);
    border-radius: 16px;
    padding: 0;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
    min-width: 320px;
    max-width: 400px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.pomodoro-timer:hover {
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.15),
        0 4px 12px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

/* 计时器容器 */
.timer-container {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 计时器头部 */
.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.timer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.timer-icon {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
}

.timer-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer-mode-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-mode {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mode-indicator {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
}

/* 时长选择器 */
.timer-duration-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.duration-btn {
    flex: 1;
    padding: 6px 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.duration-btn:hover {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.95);
}

.duration-btn.active {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* 隐藏自由计时的时长选择器（任务模式时） */
.pomodoro-timer.task-mode .timer-duration-selector {
    display: none;
}

/* 计时器显示区域 */
.timer-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
}

.timer-time {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Segoe UI', 'SF Pro Display', system-ui, sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: 1px;
    flex: 1;
}

.timer-controls {
    display: flex;
    gap: 8px;
}

.timer-play-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.timer-play-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
}

.timer-play-btn:active {
    transform: scale(0.95);
}

.timer-play-btn i {
    font-size: 18px;
}

/* 任务信息容器 */
.task-info-container {
    background: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 16px 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 120px;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

.task-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.task-header i {
    color: #6c757d;
    font-size: 14px;
}

.task-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.task-controls {
    display: flex;
    gap: 8px;
}

.pause-task-btn,
.stop-task-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pause-task-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.2);
}

.pause-task-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.stop-task-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.stop-task-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.pause-task-btn:active,
.stop-task-btn:active {
    transform: translateY(0);
}

.pause-task-btn i,
.stop-task-btn i {
    font-size: 10px;
}

/* 状态样式 */
.pomodoro-timer.task-mode .timer-container {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.pomodoro-timer.task-mode .mode-indicator {
    color: #fff;
}

.pomodoro-timer.running .timer-time {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.pomodoro-timer.running .timer-play-btn {
    background: rgba(255,255,255,0.25);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pomodoro-timer {
        min-width: 280px;
        max-width: 320px;
        left: 50%;
        top: 85%;
    }
    
    .timer-container {
        padding: 14px 16px;
    }
    
    .task-info-container {
        padding: 14px 16px;
    }
    
    .timer-time {
        font-size: 24px;
    }
    
    .timer-play-btn {
        width: 42px;
        height: 42px;
    }
    
    .duration-btn {
        font-size: 10px;
        padding: 5px 6px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .pomodoro-timer {
        background: linear-gradient(145deg, #2c3e50, #34495e);
        border-color: rgba(255,255,255,0.1);
    }
    
    .task-info-container {
        background: #34495e;
        border-top-color: rgba(255,255,255,0.1);
    }
    
    .task-name {
        color: #ecf0f1;
    }
    
    .task-header i,
    .task-label {
        color: #bdc3c7;
    }
}

/* 自由时钟模式样式 */
.pomodoro-timer.free-clock-mode .timer-container {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.pomodoro-timer.free-clock-mode .mode-indicator {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.95);
}

.pomodoro-timer.free-clock-mode .timer-time {
    font-family: 'Courier New', 'SF Mono', monospace;
    font-size: 24px;
    letter-spacing: 2px;
}

/* 自由时钟动画效果 */
.pomodoro-timer.free-clock-mode .timer-time {
    animation: clockTick 1s infinite;
}

@keyframes clockTick {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.8; }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pomodoro-timer.free-clock-mode .timer-time {
        font-size: 20px;
        letter-spacing: 1px;
    }
}

/* 基础样式保持不变，添加新的状态样式 */
.pomodoro-timer {
    position: absolute;
    top: 85%;
    left: 55%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #ffffff, #f0f2f5);
    border-radius: 16px;
    padding: 0;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
    min-width: 320px;
    max-width: 400px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 最小化状态 */
.pomodoro-timer.minimized {
    min-width: 200px;
    max-width: 200px;
    bottom: 20px;
    left: 20px;
    transform: none;
}

.pomodoro-timer.minimized .timer-duration-selector,
.pomodoro-timer.minimized .task-info-container {
    display: none;
}

.pomodoro-timer.minimized .timer-container {
    padding: 8px 12px;
}

.pomodoro-timer.minimized .timer-time {
    font-size: 18px;
}

.pomodoro-timer.minimized .timer-play-btn {
    width: 32px;
    height: 32px;
}

/* 最大化状态 */
.pomodoro-timer.maximized {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 600px;
    max-width: 800px;
    width: 80vw;
    max-height: 80vh;
    z-index: 1000;
}

.pomodoro-timer.maximized .timer-container {
    padding: 24px 32px;
}

.pomodoro-timer.maximized .timer-time {
    font-size: 48px;
}

.pomodoro-timer.maximized .timer-play-btn {
    width: 64px;
    height: 64px;
}

.pomodoro-timer.maximized .timer-play-btn i {
    font-size: 24px;
}

/* 头部控制栏 */
.timer-header-controls {
    display: flex;
    gap: 4px;
    z-index: 10;
}

.timer-minimize-btn,
.timer-maximize-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 10px;
}

.timer-minimize-btn:hover,
.timer-maximize-btn:hover {
    background: rgba(0,0,0,0.2);
    color: rgba(0,0,0,0.8);
}

/* 白噪音面板 */
.white-noise-panel {
    background: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.noise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.noise-header i {
    color: #fff;
    font-size: 14px;
}

.noise-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.noise-stop-all-btn {
    border: none;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
}

.noise-stop-all-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.noise-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.noise-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.noise-item:hover {
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.noise-toggle {
    width: 40px;
    height: 20px;
    border: none;
    border-radius: 10px;
    background: #ddd;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.noise-toggle.active {
    background: #4CAF50;
}

.noise-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.noise-toggle.active::after {
    left: 22px;
}

.noise-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
}

.noise-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.noise-volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.noise-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.noise-volume-value {
    font-size: 11px;
    color: #6c757d;
    min-width: 30px;
    text-align: right;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .pomodoro-timer.maximized {
        width: 95vw;
        max-width: none;
    }
    
    .noise-controls {
        grid-template-columns: 1fr;
    }
    
    .noise-volume-control {
        min-width: 100px;
    }
}